package com.cgwx.aop.exception;

import com.cgwx.aop.result.Result;
import com.cgwx.aop.result.ResultUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@Slf4j
@RestControllerAdvice
public class AuthExceptionHandler {
    @ExceptionHandler(AuthException.class)
    public Result doHandleArithmeticException(AuthException e){
        return ResultUtil.error(e.getCode(),e.getMessage());
    }
}
